package com.Classroom.al.dao;

import com.Classroom.al.dto.ChartData;
import com.Classroom.al.entities.Classroom;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.CrudRepository;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface ClassroomRepository extends CrudRepository<Classroom,Long> {
    @Override
    public List<Classroom> findAll();

    @Query(nativeQuery = true,value = "SELECT name ,stage AS label FROM classroom; ")
    List<ChartData> getClassroomsStatus();
    public Classroom getById(long id);


}
